<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script>
	var arr=[3,5,7,2,8,9,10,6,4,1];
	var x="";
	for (var i = 0; i < arr.length; i++) {
		for (var n = i+1; n < arr.length; n++) {
			if (arr[i]>arr[n]) {
				x=arr[n];
				arr[n]=arr[i];
				arr[i]=x;
			}
		}
	}
	console.log("选择排序法："+arr);

	var max=0;
	for (var i = 1; i < arr.length; i++) {
		if (max<arr[i]) {
			max=arr[i];
		}
	}
	console.log("数组最大值："+max)
	</script>
</body>
</html>